package com.zj.z11select.controller.client;


import com.zj.z11select.service.ShoppingCartService;
import com.zj.z11select.vo.BaseResult;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 购物车  前端控制器
 * </p>
 *
 * @author ZHOUJIE
 * @since 2021-08-03
 */
@RestController
@RequestMapping("/client/shoppingCart")
@CrossOrigin
public class ShoppingCartController {

    @Autowired
    private ShoppingCartService shoppingCartService;

    @ApiOperation("用户购物车列表")
    @GetMapping("/list")
    public BaseResult listCart(Integer userId){
        return BaseResult.success(this.shoppingCartService.listCart(userId));
    }
}

